From: Daniel Dickinson Date: Mon, 15 Nov 2010 04:08:09 +0000 (+0000) Subject: brcm63xx: imagetag: Fixed occaisonal wrong CRC in image due to using strncpy to copy... X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=ba219c3b0caf83534ab123473522ca8758266b91;p=project%2Ffirmware-utils.git brcm63xx: imagetag: Fixed occaisonal wrong CRC in image due to using strncpy to copy the CRC into the imagetag. strncpy stops copying after a 00 byte, memcpy doesn't. SVN-Revision: 24000 --- diff --git a/src/imagetag.c b/src/imagetag.c index 1fb45e9..0ecbada 100644 --- a/src/imagetag.c +++ b/src/imagetag.c @@ -32,9 +32,9 @@ union int2char { char output[4]; }; -/* This appears to be necessary due to alignment issues */ +/* Convert uint32_t CRC to bigendian and copy it into a character array */ #define int2tag(tag, value) intchar.input = htonl(value); \ - strncpy(tag, intchar.output, sizeof(union int2char)) + memcpy(tag, intchar.output, sizeof(union int2char)) /* Kernel header */ struct kernelhdr {